<%@page contentType="text/html;charset=UTF-8" isErrorPage="true"%>
<%@page import="org.apache.commons.lang3.StringUtils"%>
<%@page import="java.util.Enumeration" %>
<%@ include file="/WEB-INF/views/public/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title>操作成功</title>
	<%@include file="/WEB-INF/views/public/include/head.jsp" %>
	<link href="${ctxStatic}/common/bootstrap-custom.css" type="text/css" rel="stylesheet" />
	<style type="text/css">
		/* 类似jbox样式的错误页面的样式 */
		.message_container {width:38.3%;height:auto;margin:100px auto;background: #FFFFFF;box-shadow: 0 4px 10px 0 rgba(0,0,0,0.10);border-radius: 4px;font-family:STHeitiSC-Light;}
		.message_head {border-bottom: 1px solid #D8E2E9;padding: 21px 30px;font-size:16px;}
		.message_head span {line-height: 28px;display: inline-block;}
		.message_content {width:100%;height: 25%;;}
		.message_content span {display:inline-block;margin:50px auto;font-size: 24px;color: #333333;letter-spacing: 0;text-align:center;width:100%;}
	</style>
	
	<script type="text/javascript">
		$(document).ready(function(){
			$('#id_submit').click(function(){
				loading('正在前往指定页面，请稍候……');
				$('#submitform').submit();
				$('#id_submit').hide();
				$('#id_submit').attr("disabled", true);
			});
			
			$('#id_close').click(function(){
				try{top.$.jBox.close();}catch(e){};
				try{parent.$.jBox.close();}catch(e){};
			});
			
			<c:if test="${autoRedirect == 0 }">
					loading('正在前往指定页面，请稍候……');
					$('#submitform').submit();
					$('#id_submit').hide();
					$('#id_submit').attr("disabled", true);
			</c:if>
		});
	</script>
</head>
<body style="background: #e8eef3;">

<%
	String url = (String)request.getAttribute("redirectUrl");
	out.println("<form action='"+url+"' method='post' name='sf' id='submitform'>");
	Enumeration paramsNames = request.getAttributeNames();
	while (paramsNames.hasMoreElements()) { 
        String key = (String) paramsNames.nextElement();
        int idx = key.indexOf("param_");
        if(idx >-1) {
        	String value = (String)request.getAttribute(key);
        	out.println("<input type='hidden' name='"+key.substring(6)+"' value='"+value+"'/>");
        }
	}
%>

	
	<div class="message_container">
		<div class="message_head">
			<span class="cp-icon cp-icon-checked_right_b"></span>
			<span>提示</span>
		</div>
		<div class="message_content" style="text-align: center; padding-bottom:25px;">
			<span>${message }</span>
		<span>${redirectUrl }</span>
		
			<c:choose>
				<c:when test="${redirectUrl!=null }">
					<input type="button" id="id_submit" class="btn btn-primary" value="确定（重定向）" hidefocus="true" />
				</c:when>
				<c:otherwise>
					<input type="button" id="id_close" class="btn btn-primary" value="确定（不重定向）" hidefocus="true" />			
				</c:otherwise>
			</c:choose>
		
		
		</div>
	</div>
	
</form>	
</body>
</html>